﻿Imports System.Runtime.InteropServices

Namespace Shell32
    ' Hier werden die Schnittstellen von Klassen der Com-Library 
    '  "MS Shell Controls and Automation" implementiert, mit denen ein 
    '  Kopiervorgang durchgeführt werden kann. Dieser Kopiervorgang
    '  akzeptiert auch Zip-Dateien, nämlich als "zip-komprimierte Ordner".

    '  Die Information über Typen, Attribute und Reihenfolge der 
    '   Schnittstellenmember sind in C:\Program Files\Microsoft Visual Studio 8\
    '   VC\PlatformSDK\Include\shldisp.idl dokumentiert. Wer diese Doku in 
    '   Augenschein nehmen will, kann, falls er shldisp.idl nicht findet, das
    '   Visual Studio 2008 SDK 1.1 downloaden: 
    '   http://www.microsoft.com/downloads/details.aspx?displaylang=en&FamilyID=59ec6ec3-4273-48a3-ba25-dc925a45584d

    <Guid("00020400-0000-0000-c000-000000000046")> _
    <InterfaceType(ComInterfaceType.InterfaceIsIUnknown)> _
    Public Interface IDispatch
        <PreserveSig()> _
        Function GetTypeInfoCount() As Integer
        Function GetTypeInfo( _
            <MarshalAs(UnmanagedType.U4)> ByVal iTInfo As Integer, _
            <MarshalAs(UnmanagedType.U4)> ByVal lcid As Integer _
            ) As ComTypes.ITypeInfo
        <PreserveSig()> _
        Function GetIDsOfNames(ByRef riid As Guid, ByVal rgsNames As String(), _
          <MarshalAs(UnmanagedType.U4)> ByVal cNames As Integer, _
          <MarshalAs(UnmanagedType.U4)> ByVal lcid As Integer, _
          ByVal rgDispId As Integer()) As Integer
        <PreserveSig()> _
        Function Invoke(ByVal dispIdMember As Integer, ByRef riid As Guid, _
          <MarshalAs(UnmanagedType.U4)> ByVal lcid As Integer, _
          <MarshalAs(UnmanagedType.U4)> ByVal dwFlags As Integer, _
          ByRef pDispParams As ComTypes.DISPPARAMS, _
          <Out()> ByVal pVarResult As Object(), _
          ByRef pExcepInfo As ComTypes.EXCEPINFO, _
          <Out()> ByVal pArgErr As IntPtr()) As Integer
    End Interface

    <ComImport()> _
    <Guid("D8F015C0-C278-11CE-A49E-444553540000")> _
    <TypeLibType(TypeLibTypeFlags.FOleAutomation)> _
    <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
    Public Interface IShellDispatch
        ReadOnly Property Application() As IDispatch
        ReadOnly Property Parent() As IDispatch
        Function [Namespace](ByVal vDir As Object) As Folder
        Function BrowseForFolder(ByVal hWnd As Integer, _
                                 ByVal Title As String, _
                                 ByVal Otions As Integer, _
                                 ByVal RootFolder As Object) As Folder
        Function Windows() As IDispatch 'IDispatch
        Sub Open(ByVal vDir As Object)
        Sub Explore(ByVal vDir As Object)
        Sub MinimizeAll()
        Sub UndoMinimizeALL()
        Sub FileRun()
        Sub CascadeWindows()
        Sub TileVertically()
        Sub TileHorizontally()
        Sub ShutdownWindows()
        Sub Suspend()
        Sub EjectPC()
        Sub SetTime()
        Sub TrayProperties()
        Sub Help()
        Sub FindFiles()
        Sub FindComputer()
        Sub RefreshMenu()
        Sub ControlPanelItem(ByVal bstrDir As String)
    End Interface

    <ComImport()> _
    <Guid("BBCBDE60-C3FF-11CE-8350-444553540000")> _
    <TypeLibType(TypeLibTypeFlags.FOleAutomation)> _
    <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
    Public Interface Folder
        ReadOnly Property Title() As String
        ReadOnly Property Application() As IDispatch
        ReadOnly Property Parent() As IDispatch
        ReadOnly Property ParentFolder() As Folder ' Shell32.Folder

        ' Shell32.FolderItems
        Function Items() As FolderItems
        ' Shell32.FolderItem
        Function ParseName(ByVal bName As String) As FolderItem
        Sub NewFolder(ByVal bName As String, _
                      Optional ByVal vOptions As Object = Nothing)
        Sub MoveHere(ByVal vItem As Object, _
                     Optional ByVal vOptions As Object = Nothing)
        Sub CopyHere(ByVal vItem As Object, _
                     Optional ByVal vOptions As Object = Nothing)
        Function GetDetailsOf(ByVal vItem As Object, _
                              ByVal iColumn As Integer) As String

    End Interface

    <Guid("744129E0-CBE5-11CE-8350-444553540000")> _
    <ComImport()> _
    <TypeLibType(TypeLibTypeFlags.FOleAutomation)> _
    <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
    Public Interface FolderItems
        'Inherits IEnumerable
        ReadOnly Property Count() As Integer
        ReadOnly Property Application() As IDispatch
        ReadOnly Property Parent() As IDispatch
        Function Item(ByVal index As Object) As FolderItem

        <DispId(-4)> _
        <TypeLibFunc(TypeLibFuncFlags.FRestricted Or TypeLibFuncFlags.FHidden)> _
        Function _NewEnum() As ComTypes.IEnumVARIANT

    End Interface

    <ComImport()> _
    <TypeLibType(TypeLibTypeFlags.FOleAutomation)> _
    <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
    <Guid("FAC32C80-CBE4-11CE-8350-444553540000")> _
    Public Interface FolderItem
        ReadOnly Property Application() As IDispatch
        ReadOnly Property Parent() As IDispatch
        Property Name() As String
        ReadOnly Property Path() As String
        ReadOnly Property GetLink() As IDispatch
        ReadOnly Property GetFolder() As IDispatch
        ReadOnly Property IsLink() As Boolean
        ReadOnly Property IsFolder() As Boolean
        ReadOnly Property IsFileSystem() As Boolean
        ReadOnly Property IsBrowsable() As Boolean
        Property ModifyDate() As Date
        ReadOnly Property Size() As Integer
        ReadOnly Property Type() As String
        Function Verbs() As FolderItemVerbs
        Sub InvokeVerb(ByVal vVerb As Object)
    End Interface

    <ComImport()> _
    <TypeLibType(TypeLibTypeFlags.FOleAutomation)> _
    <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
    <Guid("1F8352C0-50B0-11CF-960C-0080C7F4EE85")> _
    Public Interface FolderItemVerbs
        'Inherits IEnumerable
        ReadOnly Property Count() As Integer
        ReadOnly Property Application() As IDispatch
        ReadOnly Property Parent() As IDispatch
        Function Item(ByVal index As Object) As FolderItemVerb

        <DispId(-4)> _
        <TypeLibFunc(TypeLibFuncFlags.FRestricted Or TypeLibFuncFlags.FHidden)> _
        Function _NewEnum() As ComTypes.IEnumVARIANT
    End Interface

    <ComImport()> _
    <TypeLibType(TypeLibTypeFlags.FOleAutomation)> _
    <InterfaceType(ComInterfaceType.InterfaceIsDual)> _
    <Guid("08EC3E00-50B0-11CF-960C-0080C7F4EE85")> _
    Public Interface FolderItemVerb
        ReadOnly Property Application() As IDispatch
        ReadOnly Property Parent() As IDispatch
        ReadOnly Property Name() As String
        Sub DoIt()
    End Interface


End Namespace
